﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls
{
    /// <summary>
    ///气管插拔管
    /// </summary>
    public partial class QGCBGCtrl : EventIcon
    {

        #region Variables

        #endregion

        #region Constructor

        public QGCBGCtrl()
        {
            InitializeComponent();
        }

        #endregion

        #region Properties

        #endregion

        #region 依赖属性

        #endregion

        #region Event

        #endregion

        #region Private Methods

        private void QGCG()
        {
            Ellipse el = new Ellipse();
            el.Height = this.Height * 0.8;
            el.Width = this.Width;
            el.Stroke = Brushes.Black;
            el.Fill = Brushes.Transparent;
            el.StrokeThickness = StrokeThickness;
            DefaultColor = Brushes.Black;
            _grid.Children.Add(el);

            Line line = new Line()
            {
                X1 = this.Width / 2,
                Y1 = 0,
                X2 = this.Width / 2,
                Y2 = this.Height,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line);
        }

        private void QGBG()
        {
            Ellipse el = new Ellipse();
            el.Height = this.Height;
            el.Width = this.Width * 0.8;
            el.Stroke = Brushes.Black;
            el.Fill = Brushes.Transparent;
            el.StrokeThickness = StrokeThickness;
            DefaultColor = Brushes.Black;
            _grid.Children.Add(el);

            Line line = new Line()
            {
                X1 = 0,
                Y1 = this.Height / 2,
                X2 = this.Width,
                Y2 = this.Height / 2,
                Stroke = Brushes.Black,
                StrokeThickness = StrokeThickness
            };
            _grid.Children.Add(line);
        }

        #endregion

        #region Public/Protected Methods

        public override void ResizeIcon()
        {
            if (Identify)
            {
                QGCG();
            }
            else
            {
                QGBG();
            }
        }

        #endregion

        #region EventHandlers

        #endregion
    }
}
